home *** CD-ROM | disk | FTP | other *** search
- /* TRUCKS.KB */
- /* Paul Harmon example from Expert System Strategies, Vol. 5, No. 12 Dec. '89 */
-
- /* This knowledge base represents a set of trucks and drivers.
- The rule (there is just one!)
- uses pattern-matching to allocate available drivers to available trucks,
- and adds the solutions as list-pairs into working memory.
- Harmon uses this example to test whether an expert shell has true
- pattern-matching (MIKE does). To run, toggle on tracing option number 5 via
- ?- tracing(5).
- and invoke the forward chainer via
- ?- fc.
-
- */
-
-
-
- driver1 instance_of driver with
- name: bill,
- status: available,
- city: la.
-
- driver2 instance_of driver with
- name: steve,
- status: unavailable,
- city: sf.
-
- driver3 instance_of driver with
- name: marge,
- status: available,
- city: sf.
-
- driver4 instance_of driver with
- name: lee,
- status: available,
- city: la.
-
- truck1 instance_of truck with
- license: 542328,
- status: available,
- city: la.
-
- truck2 instance_of truck with
- license: 776343,
- status: available,
- city: la.
-
- truck3 instance_of truck with
- license: 115444,
- status: available,
- city: sf.
-
- truck4 instance_of truck with
- license: 203300,
- status: unavailable,
- city: on_road.
-
- rule demo forward
- if
- Driver instance_of driver &
- Truck instance_of truck &
- the status of Driver is available &
- the status of Truck is available &
- the city of Driver is City &
- the city of Truck is City
- then
- add [Driver, Truck] &
- note the status of Driver is unavailable &
- note the status of Truck is unavailable.